<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>阻止冒泡</title>
<!--引入Vue库-->
<script src="vue.js"></script>
</head>
<body>	
<div id="app" @click="setVal1">
  <button @click="setVal2">普通按钮</button>
  <button @click.stop="setVal2">阻止冒泡</button>
  <button @click="reset">还原</button>
  <p>{{ result }}</p>
</div>
<script>
var vm = new Vue({
    el: '#app',
    data:{
      result:''
    },
    methods:{
      setVal1(){
        this.result+=' 父级 ';
      },		
      setVal2(event){
        this.result+=' 子级 ';
      },
      reset(){
        history.go()
      }
    }
  })
</script>
</body>
</html>
